<!-- Ini navigasi tambah produk -->
<ul class="nav nav-tabs" role="tablist" id="myTab">
  <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab"><i class="glyphicon glyphicon-th-list"></i> Data Kategori</a></li>
  <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab"><i class="glyphicon glyphicon-plus"></i> Tambah Kategori</a></li>
</ul>

<!-- Ini tab conten navigasi -->
<div class="tab-content">
<!-- Ini tab conten navigasi panel home-->
  <div role="tabpanel" class="tab-pane active" id="home">
  <br/>
  <div class="alert alert-info">
    <a class="close" data-dismiss="alert">x</a>
		<strong>Info </strong> Pada halaman ini Anda dapat menghapus dan edit Data Kategori ..
	</div>
  <?php if($this->session->flashdata('info')) { ?>
    <div class="alert alert-info">  
        <a class="close" data-dismiss="alert">x</a>  
        <strong>Info! </strong><?php echo $this->session->flashdata('info'); ?>  
    </div>
  <?php } ?>
	<div class="table">
	 <?php
    if(empty($hasil)){
        echo "Tidak ada data";
    }
    else{
    ?>
		<table class="table">
			<tr class="table table-bordered active">
				<td><strong> No </strong></td>
				<td><strong>Nama</strong></td>
				<td><strong>Brand </strong> </td>
				<td align="center"><strong>Action </strong></td>
			</tr>
		  <?php
        	$no = 1;
        	foreach($hasil as $data) {
        ?>
        <tr>
			<tr class="table">
				<td><?php echo $no++ ;?></td>
        <td><?php echo $data->nama_kategori;?></td>
        <td><?php echo $data->brand ;?></td>
				<td border="0" align="center">
				<a title="Edit Produk Produk" href="<?php echo site_url(); ?>/admin/edit_kategori/<?php echo $data->id_kategori; ?>">
					<i class="glyphicon glyphicon-pencil"></i> Edit	</a> | <a href="#" onClick="if(confirm('Anda yakin HAPUS data ini? ')){document.location='<?php echo site_url()?>/admin/hapus_kategori/<?php echo $data->id_kategori; ?>'}" title="Hapus Kategori" >
					<i class="glyphicon glyphicon-trash"></i> Hapus </a>
				</td>
			</tr>
		<?php } ?>
		</table>
		<?php
    		}
    	?>
		</div>
	<nav>
  		<ul class="pagination" align="right">
    		<li><a href="#"><span aria-hidden="true" class"glyphicon glyphicon-chevron-left"></span><span class="glyphicon glyphicon-chevron-left"></span></a></li>
    		<li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
    		<li><a href="#">2 <span class="sr-only">(current)</span></a></li>
    		<li><a href="#">3 <span class="sr-only">(current)</span></a></li>
    		<li><a href="#">4 <span class="sr-only">(current)</span></a></li>
    		<li><a href="#"><span aria-hidden="true" class"glyphicon glyphicon-chevron-right"></span><span class="glyphicon glyphicon-chevron-right"></span></a></li>
  		</ul>
	</nav>
  </div>

  <!-- Ini tab conten navigasi panel profile -->
  <div role="tabpanel" class="tab-pane" id="profile">
  <br>
  <div class="alert alert-info">
    <a class="close" data-dismiss="alert">x</a>
    <strong>Info </strong> Pada halaman ini Anda dapat menambahkan kategori sesuai dengan kebutuhan Anda ..
  </div>
  <?php if($this->session->flashdata('info')) { ?>
    <div class="alert alert-info">  
        <a class="close" data-dismiss="alert">x</a>  
        <strong>Info! </strong><?php echo $this->session->flashdata('info'); ?>  
    </div>
  <?php } ?>
  <div class="row">
  <div class="col-lg-10">
    <form class="form-horizontal" role="form" name="tambah_kategori" method="post" action="<?php echo site_url('admin/proses_tambah_kategori') ?>">
        <div class="form-group">
          <label for="inputEmail3" class="col-sm-3 control-label">Nama Kategori</label>
          <div class="col-sm-6">
            <input type="text" class="form-control" id="inputEmail3" placeholder="Nama Kategori" name="nama_kategori">
          </div>
        </div>
        <div class="form-group">
          <label for="inputEmail3" class="col-sm-3 control-label">Brand</label>
          <div class="col-sm-6">
            <input type="text" class="form-control" id="inputEmail3" placeholder="Brand" name="brand">
          </div>
        </div>
        <br>
        <div class="form-group">
          <div class="col-sm-offset-3 col-sm-10">
            <input class="btn btn-primary" type="submit" value="Simpan" />
            <input class="btn btn" type="button" name="Batal" onclick="javascript:document.location.href='<?php echo site_url('admin/kategori') ?>'" value="Batal" />
          </div>
        </div>
    </form>  
  </div>
  </div>
</div>
</div>

<!-- Fungsi Tab Pada Bootstrap -->
<script>
  $(function () {
    $('#myTab a:last').tab('show')
  })
</script>